package com.example.fengshoutong.ui;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.example.fengshoutong.R;
import com.example.fengshoutong.utils.FragmentUtils;

/**
 * 发布页面
 */
public class PublishFragment extends Fragment {

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_publish, container, false);
    }

    @Override
    public void onResume() {
        super.onResume();
        initView();
    }

    private void initView() {
        // 发布商品
        getView().findViewById(R.id.ll_publish_good).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                FragmentUtils.getInstance().switchFragment(R.id.nav_publish_good);
            }
        });
        // 发布文章
        getView().findViewById(R.id.ll_publish_article).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                FragmentUtils.getInstance().switchFragment(R.id.nav_publish_article);
            }
        });
    }

}
